<template>
  <div>
   <h2>亲，请登录~</h2>
    <p><span>用户名</span><input type="text"></p>
    <p><span class="pa">密码</span><input type="text"></p>
    <button type="button" @click="fun()">登录</button>
    <button type="button" @click="fun1()">退出</button>
  </div>
</template>

<script>
import { Dialog } from 'vant';
export default {
  methods:{
    fun(){
      document.querySelector("button").style.opacity=0.7
    },
    fun1(){
      Dialog({ message: '确认退出吗' }).then(()=>{
        this.$router.push("/home")
      });
     
    }
    
  }
}
</script>

<style scoped>

  h2{
    width: 100%;
    height: 0.6rem;
    line-height: 0.6rem; 
    text-align: center;
  }
  p:nth-of-type(1){
    margin-top: 0.2rem;
    margin-bottom: 0.2rem;
  }
  p:nth-of-type(2){
    margin-top: 0.2rem;
    margin-bottom: 0.2rem;
    /* padding-left: 0.2rem; */
  }
  button{
    text-align: center;
    line-height: 0.44rem;
    width: 3.2rem;
    margin-left: 0.22rem;
    margin-top: 0.4rem;
    color: #fff;
    background-color: #2873ff;
    border-radius: .1875rem;
    letter-spacing: 2px;
    outline: none;
    border: none;
  }
  span{
    color: #333;
    font-size: 0.18rem;
    margin-right: 0.3rem;
    width: 0.54rem;
    margin-left: 0.3rem;
  }
  .pa{
    margin-right: 0.48rem;
  }
  input{
    width: 2.2rem;
    height: 0.35rem;
    background-color: rgba(235, 40, 40, 0.2);
    outline: none;
    border: none;
    border-radius: 0.1rem;
    text-indent: 1em;
  }
  
</style>